CygNet Studio > Scripting in CygNet Studio > Scripting Examples > Synchronizing the View with a Group Navigation Bar

Synchronizing the View with a Group Navigation Bar

The main event of the Group Navigation Bar is the EventOnSelChangeLevel event, which is fired when a user changes the current selection of the Navigation Bar. The code below makes use of this event by setting the View’s SiteService and Facility properties to match the ~ref_site, ~ref_serv, and ~ref_id attributes of the navigation bar’s selected node at all times. This script also demonstrates the GetSelectedNodeAttrValue method of the navigation bar.

Sub NavBar_EventOnSelChangeLevel(Level)

Dim This : Set This = NavBar

 

TheView.SiteService = NavBar.GetSelectedNodeAttrValue(NavBar.TargetLevel, "~ref_site")
+ _  "." + NavBar.GetSelectedNodeAttrValue(NavBar.TargetLevel, "~ref_serv")

 

TheView.Facility = NavBar.GetSelectedNodeAttrValue(NavBar.TargetLevel, "~ref_id")

End Sub

For more examples, see GRPDTL.csf and GRPSUM.csf in the APPS SCREXAMP folder.


Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.